@page
{{~ if !Option.SkipPermissions ~}}
@using {{ ProjectInfo.FullName }}.Permissions
{{~ end ~}}
{{~ if Bag.PagesFolder; pagesNamespace = Bag.PagesFolder + "."; end ~}}
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using {{ ProjectInfo.FullName }}.Web.Pages.{{ pagesNamespace }}{{ EntityInfo.RelativeNamespace }}.{{ EntityInfo.Name }}
@using {{ ProjectInfo.FullName }}.Localization
@using {{ ProjectInfo.FullName }}.Web.Menus
@model IndexModel
@inject IPageLayout PageLayout
@inject IHtmlLocalizer<{{ ProjectInfo.Name }}Resource> L
{{~ if !Option.SkipPermissions ~}}
@inject IAuthorizationService Authorization
{{~ end ~}}
{{~ if Bag.PagesFolder; pagesFolder = Bag.PagesFolder + "/"; end ~}}
@{
    PageLayout.Content.Title = L["{{ EntityInfo.Name }}"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:{{ EntityInfo.Name }}"].Value);
    PageLayout.Content.MenuItemName = {{ ProjectInfo.Name }}Menus.{{ EntityInfo.Name }};
}

@section scripts
{
    <abp-script src="/Pages/{{ pagesFolder }}{{ EntityInfo.RelativeDirectory }}/{{ EntityInfo.Name }}/index.js" />
}
@section styles
{
    <abp-style src="/Pages/{{ pagesFolder }}{{ EntityInfo.RelativeDirectory }}/{{ EntityInfo.Name }}/index.css"/>
}

<abp-card>
    <abp-card-header>
        <abp-row>
            <abp-column size-md="_6">
                <abp-card-title>@L["{{ EntityInfo.Name }}"]</abp-card-title>
            </abp-column>
            <abp-column size-md="_6" class="text-right">
{{~ if !Option.SkipPermissions ~}}
			    @if (await Authorization.IsGrantedAsync({{ ProjectInfo.Name }}Permissions.{{ EntityInfo.Name }}.Create))
                {
{{~ end ~}}
                <abp-button id="New{{ EntityInfo.Name }}Button"
                            text="@L["Create{{ EntityInfo.Name }}"].Value"
                            icon="plus"
                            button-type="Primary" />
{{~ if !Option.SkipPermissions ~}}
                }
 {{~ end ~}}
            </abp-column>
        </abp-row>
    </abp-card-header>
    <abp-card-body>
        <abp-table striped-rows="true" id="{{ EntityInfo.Name }}Table" class="nowrap">
            <thead>
            <tr>
                <th>@L["Actions"]</th>
                {{~ for prop in EntityInfo.Properties ~}}
                {{~ if prop | abp.is_ignore_property; continue; end ~}}
                <th>@L["{{ EntityInfo.Name + prop.Name }}"]</th>
                {{~ end ~}}
            </tr>
            </thead>
        </abp-table>
    </abp-card-body>
</abp-card>